﻿using System;
using System.Windows;
using System.Windows.Input;

using SBPweb.PROvibe.Client.Library.Base;
using SBPweb.PROvibe.Client.Library.Controls;

namespace SBPweb.PROvibe.Client.Modules.MOSS14Connector.Controls
{

    public partial class ModuleBarItem : ModuleBarItemBase
    {

        #region Private fields

        private MainWindow mw;

        #endregion

        #region Constructor logic

        public ModuleBarItem()
            : base()
        {
            InitializeComponent();
        }

        #endregion

        #region Methods

        protected override void InitializeHandlers()
        {
            base.InitializeHandlers();
            if (mw == null)
            {
                mw = new MainWindow();
                mw.Name = "Moss14Window";
                mw.Loaded += new System.Windows.RoutedEventHandler(mw_Loaded);
            }
        }

        protected override void OnLoaded(object sender, RoutedEventArgs e)
        {
            base.OnLoaded(sender, e);
        }

        private void mw_Loaded(object sender, RoutedEventArgs e)
        {
        }

        #endregion

        #region Event handlers

        private void ToolBarItem_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            if (mw != null)
            {
                mw.Open();
            }
        }

        #endregion

    }

}